{% extends "layouts/main.html" %}
{% import 'components/utils.html' as utils %}

{% set pageTitle = "招聘信息管理" %}
{% set pageDesc = "招聘信息列表" %}

{% block content %}

<div class="box">
    <div class="box-header">
        <h3 class="box-title">Jobs</h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
            <div class="row">
                <div class="col-sm-6"></div>
                <div class="col-sm-6"></div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <table id="example2" class="table table-bordered table-hover dataTable" role="grid"
                           aria-describedby="example2_info">
                        <thead>
                            <tr role="row">
                                <th>#</th>
                                <th>标题</th>
                                <th>宣讲时间</th>
                                <th>关注人数</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                                {% if not jobs %}
                                <tr><td colspan="5">暂无数据</td></tr>
                                {% endif %}
                                {% for j in jobs %}
                                <tr class="{{ loop.cycle('odd', 'even') }}">
                                    <td>{{ loop.index }}</td>
                                    <td>
                                        <a href="{{ url_for('main.job_detail', id=j.id) }}">{{ j.title }}</a>
                                    </td>
                                    <td>{{ j.open_date }}</td>
                                    <td>{{ j.followers.count() }}</td>
                                    <td>{{ j.create_date }}</td>
                                    <td>
                                        <a href="{{ url_for('main.job_detail', id=j.id) }}" title="查看">
                                            <i class="fa fa-eye"></i></a> &nbsp;&nbsp;
                                        <a href="{{ url_for('main.status_job', id=j.id) }}"
                                           title="{{ '删除' if j.status == 1 else '显示' }}">
                                            <i class="fa {{ 'fa-times' if j.status == 1 else 'fa-check' }}"></i>
                                        </a>
                                    </td>
                                </tr>
                                {% endfor %}
                        </tbody>
                        <tfoot>
                            <tr role="row">
                                <th>#</th>
                                <th>标题</th>
                                <th>宣讲时间</th>
                                <th>关注人数</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
            {{ utils.pager_render(pagination) }}
        </div>
    </div>
    <!-- /.box-body -->
</div>

{% endblock %}